package com.cy.myblog.dao;

import com.cy.myblog.aspect.LogInfo;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;

public interface BaseDaoI<T> {

	public Serializable save(T o);
	
	public void delete(T o);
	
	public void update(T o);
	
	public void saveOrUpdate(T o);

	@LogInfo("执行了通过id查询用户的信息!")
	public T getById(Class<T> clazz, Serializable id);
	
	public T getByHql(String hql);
	
	public T getByHql(String hql, Map<String, Object> params);
	
	public List<T> find(String hql);
	
	public List<T> find(String hql, Map<String, Object> params);
	
	public List<T> find(String hql, int page, int rows);
	
	public List<T> find(String hql, Map<String, Object> params, int page, int rows);
	
	public Long count(String hql);
	
	public Long count(String hql, Map<String, Object> params);
	
	public int executeHql(String hql);
	
	public int executeHql(String hql, Map<String, Object> params);
	
	public List<Map> findBySql(String sql);
	
	public List<Map> findBySql(String sql, int page, int rows);
	
	public List<Map> findBySql(String sql, Map<String, Object> params);
	
	public List<Map> findBySql(String sql, Map<String, Object> params, int page, int rows);
	
	public int executeSql(String sql);
	
	public int executeSql(String sql, Map<String, Object> params);
	
	public BigInteger countBySql(String sql);
	
	public BigInteger countBySql(String sql, Map<String, Object> params);
}
